import request from "./request";

export const queryConfig = (params: any) => {
	return request.get("/config/values", params);
};

// 获取入口轮播图
export const searchBanner = (data: any) => {
	return request.post('/banner/searchBanner', data);
};

// 用户登录，获取token
export const getUserToken = (code: any) => {
	return request.post('/user/getToken', {	
		code: code
	});
};

// 检查token是否还生效
export const checkToken = (token: any) =>  {
	return request.get('/user/checkToken', {
		token: token
	});
};

// 根据token获取用户信息
export const appletUserInfo = (token: any) => {
	return request.post('/user/getUserInfo', {
		token
	});
};

// 登录，获取用户权限
export const login_user = (params: any) => {
	return request.post('/user/userLogin', {
		token: params.token,
		utid: params.utid,
		account: params.account,
		password: params.password,
	});
};

// 获取主页公共图片列表
export const searchPicture = (params: {
	pageNumber: Number,
	pageSize: Number,
	searchVal?: String,
	orders?: {
		column: String,
		order: String,
	}
}) => {
	return request.post('/picture/searchPicture', params);
};

// 获取主图
export const getMainPicture = (params: any) => {
	return request.post('/picture/getMainPicture', params);
};

// 获取个人权限图片列表
export const searchPersonPicture = (params: any) => {
	return request.post('/picture/searchPersonPicture', params);
};

// 获取简语信息 - 暂去除
export const searchInfo = (params: any) => {
	return request.post('/info/searchInfo', params);
};
